<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>处理用户输入</title>
</head>
<body>
<div id="example">
    <span>{{ message }}</span>
    <button v-on:click="reverseMessage">reverseMessage</button>
</div>
<script src="../js/vue.js"></script>
<script>
    new Vue({
        el: '#example',
        data: { message: 'Hello World!'},
        methods: {
            reverseMessage: function () {
                this.message = this.message.split('').reverse().join('');
            }
        }
    });
</script>
</body>
</html>